<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<script type="text/javascript" src="js/test.js"></script>
<script type="text/javascript">
    testAdd(1,2);
    var a="zhangsan";
    var b=a;
    b="lisi";
    console.log(a);

    var stu1={name:"zhangsan"};
    //var stu2=stu1;//想办法保证stu2和stu1不是同一个对象
    var str = JSON.stringify(stu1);//将json对象转换为json字符串."{'name':'zhangsan'}"
    var stu2 = JSON.parse(str);//再将json字符串转换为json对象.

    stu2.name="lisi";
    console.log(stu1.name);
</script>
</body>
</html>